module.exports=(app)=>{
    return async(ctx, next)=>{
        ctx.socket.emit('res','connected!')
        console.log('连接成功！')
        ctx.socket.on('sayTo',res=>{
            const socketId = ctx.socket.id
            ctx.session.soke={
                userId:res.user.payload,
                socketId,
            }
        })
        await next
        console.log('断开连接！')
    }
}